package org.summerframework.component.security.core;


import org.summerframework.core.base.result.ResultCode;

/**
 * 返回code
 *
 * @author 石超
 * @version v1.0.0
 */
public enum SecurityResultCode implements ResultCode {
    //
    SUCCESS(0, "success"),
    ERROR_NOT_LOGIN(601, "请登录后重试"),
    ERROR_USER_PHONE_PROMOTED_TYPE(602, "请输入用户名后重新登录。"),
    ERROR_USER_NOT_FOUND(603, "该用户不存在或已被删除。"),
    ERROR_STAT_USER_FROZEN(604, "该账户已被冻结，暂时无法登录。"),
    ERROR_STAT_NOT_ROLE(605, "权限不足。"),
    ERROR_VERIFICTION_FREEZE_EVER(606, "你的账号已冻结! 请联系管理员后重新登录"),
    ERROR_PASSWORD_NOT_MATCH(610, "您输入的密码和账户名不匹配，请重新输入。"),
    ERROR_USER_SYSN_HAVE_LOGIN(611, "抱歉, 您访问的页面需要授权, 请联系管理员"),
    ERROR_NOT_LOGIN_SERVER(612, "没有登录对应的处理方法"),
    ERROR_STAT_NOT_ONE_ROLE(613, "当前账户无任何权限。请联系管理员"),
    ERROR_CAPTCHA_ERROR(614, "请输入正确的验证码。"),
    ERROR_MOBILE_PROMOTED_TYPE(615,"请输入正确的手机号"),
    ERROR_MOBILE_CODE_NOT_MATCH(616,"您输入的手机号和验证码不匹配，请重新输入。"),
    ;
    private int code;

    private String msg;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public String toString() {
        return code + ":" + msg;
    }

    private SecurityResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
